import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'
import AppIndex from '@/components/AppIndex.vue';
import Home from '@/components/Home'
import LibraryIndex from '@/components/library/LibraryIndex';
import Register from '@/components/Register'
import Information from '@/components/library/Information'
import Changpassword from '@/components/Changpassword'
import Personalpage from '@/components/library/Personalpage'
import LastIndex from '@/components/houtai/LastIndex'
import OrderPage from '@/components/houtai/OrderPage'
import CustomerPage from '@/components/houtai/CustomerPage'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/index',
      children: [
        // {
        //   path: '/login',
        //   name: 'Login',
        //   component: Login
        // },
        {
          path: '/index',
          name: 'AppIndex',
          component: AppIndex,
          meta: {
            requireAuth: true
          }

        }, {
          path: '/library',
          name: 'library',
          component: LibraryIndex,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/personalpage',
          name: 'Personalpage',
          component: Personalpage,
          meta: {
            requireAuth: true
          }
        },    {
          path: '/lastindex',
          name: 'LastIndex',
          component: LastIndex,
          meta: {
            requireAuth: true
          }
        },
        {
      path: '/orderpage',
      name: 'OrderPage',
      component: OrderPage,
      meta: {
        requireAuth: true
      }
    },
{
      path: '/customerpage',
      name: 'CustomerPage',
  component: CustomerPage,
  meta: {
        requireAuth:true
      }
    },
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    
    {
      path: '/register',
      name: 'Register'
      , component: Register
    },
    {
      path: '/information',
      name: "Information",
      component: Information,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/changpassword',
      name: 'Changpassword',
      component: Changpassword,
      meta: {
        requireAuth: true
      }
    },
    







  ]
})

